package com.xxljob.demo.core.model;

import java.util.Date;

/**
 * @Author：YH
 * @Description：日志记录信息
 * @Date:Created in 2022/5/22 0:47
 */
public class XxlJobLog {

    private long id;

    // job info
    /**
     * 执行器主键ID
     **/
    private int jobGroup;

    /**
     * '任务，主键ID',
     **/
    private int jobId;

    // execute info
    /**
     * 执行器地址，本次执行的地址
     **/
    private String executorAddress;

    /**
     * 执行器任务handler
     **/
    private String executorHandler;

    /**
     * 执行器任务参数
     **/
    private String executorParam;

    /**
     * 执行器任务分片参数，格式如 1/2
     **/
    private String executorShardingParam;

    /**
     * 失败重试次数
     **/
    private int executorFailRetryCount;

    // trigger info
    /**
     * 调度-时间
     **/
    private Date triggerTime;
    /**
     * 调度-结果
     **/
    private int triggerCode;
    /**
     * 调度-日志
     **/
    private String triggerMsg;

    // handle info
    /**
     * 执行-时间
     **/
    private Date handleTime;
    /**
     * 执行-状态
     **/
    private int handleCode;
    /**
     * 执行-日志
     **/
    private String handleMsg;

    // alarm info
    /**
     * '告警状态：0-默认、1-无需告警、2-告警成功、3-告警失败'
     **/
    private int alarmStatus;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public int getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(int jobGroup) {
        this.jobGroup = jobGroup;
    }

    public int getJobId() {
        return jobId;
    }

    public void setJobId(int jobId) {
        this.jobId = jobId;
    }

    public String getExecutorAddress() {
        return executorAddress;
    }

    public void setExecutorAddress(String executorAddress) {
        this.executorAddress = executorAddress;
    }

    public String getExecutorHandler() {
        return executorHandler;
    }

    public void setExecutorHandler(String executorHandler) {
        this.executorHandler = executorHandler;
    }

    public String getExecutorParam() {
        return executorParam;
    }

    public void setExecutorParam(String executorParam) {
        this.executorParam = executorParam;
    }

    public String getExecutorShardingParam() {
        return executorShardingParam;
    }

    public void setExecutorShardingParam(String executorShardingParam) {
        this.executorShardingParam = executorShardingParam;
    }

    public int getExecutorFailRetryCount() {
        return executorFailRetryCount;
    }

    public void setExecutorFailRetryCount(int executorFailRetryCount) {
        this.executorFailRetryCount = executorFailRetryCount;
    }

    public Date getTriggerTime() {
        return triggerTime;
    }

    public void setTriggerTime(Date triggerTime) {
        this.triggerTime = triggerTime;
    }

    public int getTriggerCode() {
        return triggerCode;
    }

    public void setTriggerCode(int triggerCode) {
        this.triggerCode = triggerCode;
    }

    public String getTriggerMsg() {
        return triggerMsg;
    }

    public void setTriggerMsg(String triggerMsg) {
        this.triggerMsg = triggerMsg;
    }

    public Date getHandleTime() {
        return handleTime;
    }

    public void setHandleTime(Date handleTime) {
        this.handleTime = handleTime;
    }

    public int getHandleCode() {
        return handleCode;
    }

    public void setHandleCode(int handleCode) {
        this.handleCode = handleCode;
    }

    public String getHandleMsg() {
        return handleMsg;
    }

    public void setHandleMsg(String handleMsg) {
        this.handleMsg = handleMsg;
    }

    public int getAlarmStatus() {
        return alarmStatus;
    }

    public void setAlarmStatus(int alarmStatus) {
        this.alarmStatus = alarmStatus;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("XxlJobLog{");
        sb.append("id=").append(id);
        sb.append(", jobGroup=").append(jobGroup);
        sb.append(", jobId=").append(jobId);
        sb.append(", executorAddress='").append(executorAddress).append('\'');
        sb.append(", executorHandler='").append(executorHandler).append('\'');
        sb.append(", executorParam='").append(executorParam).append('\'');
        sb.append(", executorShardingParam='").append(executorShardingParam).append('\'');
        sb.append(", executorFailRetryCount=").append(executorFailRetryCount);
        sb.append(", triggerTime=").append(triggerTime);
        sb.append(", triggerCode=").append(triggerCode);
        sb.append(", triggerMsg='").append(triggerMsg).append('\'');
        sb.append(", handleTime=").append(handleTime);
        sb.append(", handleCode=").append(handleCode);
        sb.append(", handleMsg='").append(handleMsg).append('\'');
        sb.append(", alarmStatus=").append(alarmStatus);
        sb.append('}');
        return sb.toString();
    }
}
